In general, the functionality of a computer system is achieved using the combination of hardware and software. The hardware includes functionality to execute the instructions defined in the software. The combination of the hardware and the software allows the user to perform various tasks, such as play games, perform word processing applications, perform complicated modeling of a region, design new technologies, and/or perform other such tasks.
In order to function properly, software may require the computer system to keep track of and provide software with a current time. For example, a database application may require the current time value in order to properly log when changes are made to the database. Similarly, a calendar application may rely on the current time value in order to issue reminders of calendar events. Email applications rely on clocks to determine when email is sent and received.
When an application requires the current time, a trap is issued to the kernel with a system call to obtain the current time value. In response to the trap, the computer system switches to kernel mode. Further, the kernel identifies the current time value. The kernel responds to the application with the current time value and control is switched back to the application. Thus, the application continues processing with the time value provided by the kernel. When the application requires an updated current time value, another trap is issued to the kernel.